From: Giovanni Campagna Date: Wed, 22 Aug 2012 11:54:48 +0000 (+0200) Subject: AutorunManager: Fix fallout from LoginManager rework X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6071 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e9a4843eb0f3810284d980c2bba8047c56be0064;p=gnome-shell.git AutorunManager: Fix fallout from LoginManager rework AutorunManager relied on AutomountManager to find if the session was active, and this broke when this stopped exporting a public method for it. Fix AutorunManager to have its own reference to the LoginManager. https://bugzilla.gnome.org/show_bug.cgi?id=682455 --- diff --git a/js/ui/autorunManager.js b/js/ui/autorunManager.js index df17bf8b0..f39ada3eb 100644 --- a/js/ui/autorunManager.js +++ b/js/ui/autorunManager.js @@ -4,6 +4,7 @@ const Lang = imports.lang; const Gio = imports.gi.Gio; const St = imports.gi.St; +const LoginManager = imports.misc.loginManager; const Main = imports.ui.main; const MessageTray = imports.ui.messageTray; const ShellMountOperation = imports.ui.shellMountOperation; @@ -142,6 +143,8 @@ const AutorunManager = new Lang.Class({ Name: 'AutorunManager', _init: function() { + this._loginManager = LoginManager.getLoginManager(); + this._volumeMonitor = Gio.VolumeMonitor.get(); this._volumeMonitor.connect('mount-added', @@ -176,7 +179,7 @@ const AutorunManager = new Lang.Class({ _onMountAdded: function(monitor, mount) { // don't do anything if our session is not the currently // active one - if (!Main.automountManager.isSessionActive()) + if (!this._loginManager.sessionActive) return; let discoverer = new ContentTypeDiscoverer(Lang.bind (this,